package com.dxysun.user.userservice;

import com.dxysun.service.api.clients.OrderServiceFeignClient;
import com.dxysun.service.api.dto.OrderDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController
{

	@Autowired
	private OrderServiceFeignClient orderServiceFeignClient; //动态代理

	@GetMapping("/test")
	public String test()
	{
		return orderServiceFeignClient.orders();
	}

	@GetMapping("/test1")
	public String test1()
	{
		OrderDto orderDto = new OrderDto();
		return orderServiceFeignClient.insert(orderDto) + "";
	}

	@PostMapping("/test2")
	public String insert()
	{
		OrderDto orderDto = new OrderDto();
		return orderServiceFeignClient.insert(orderDto) + "";
	}
}
